
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/20
  Time: 11:23
  To change this template use File | Settings | File Templates.
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath(); %>
<div class="result-list">
    <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
</div>
<table class="result-tab" width="100%">
    <tr>
        <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
        <th>ID</th>
        <th>公司用户名</th>
        <th>公司名</th>
        <th>公司法人</th>
        <th>公司logo</th>
        <th>公司创立时间</th>
        <th>查看公司信息</th>
        <th>当天职位发布数量</th>
        <th>发布职位数量</th>
        <th>收到简历数量</th>
        <th>是否认证</th>
        <th>是否开招聘服务</th>
        <th>操作</th>
    </tr>

        <c:forEach items="${pageInfo.list}" var="page">
    <tr id="tr${page.id}">

            <td class="tc"><input name="id[]" value="58" id="choose${page.id}" type="checkbox"></td>

            <td>${page.id}</td>
            <td>${page.username}</td>
            <td>${page.companyName}</td>
            <td>${page.legalName}</td>
            <td>
                <img  width="75" height="75" src="<%=path%>/static/uploadImg/${page.logo}">
            </td>
            <td><fmt:formatDate value="${page.createTime}" pattern="yyyy-MM-dd " /></td>
            <td><a href="<%=path%>/manage/company/companytdetails?id=${page.id}">点击查看</a></td>
            <td>${page.nowJobCount}</td>
            <td>${page.jobCount}</td>
            <td>${page.resumeCount}</td>
            <td class="authable" data-id="${page.id}"><c:if test="${page.authable eq true}"><img src="${pageContext.request.contextPath}/static/manageimages/onCorrect.gif"/></c:if>

            </td>

            <td class="opened" data-id="${page.id}"><c:if test="${page.opened eq true}"><img src="${pageContext.request.contextPath}/static/manageimages/onCorrect.gif"/></c:if>
            </td>
            <td>
                <a class="link-del" data-id="${page.id}" href="#">删除</a>
            </td>
    </tr>
        </c:forEach>


</table>

<div class="list-page">
    ${requestScope.pageInfo.total}条
    ${requestScope.pageInfo.pages}页
    <a href="#" data-pagenum="1">首页 </a>

    <c:if test="${requestScope.pageInfo.pageNum gt 1}">
        <a href="#" data-pagenum="${requestScope.pageInfo.pageNum-1}">上一页</a>
    </c:if>


    <c:forEach begin="1" end="${requestScope.pageInfo.pages}" var="i">

        <a href="#" data-pagenum="${i}"
                <c:if test="${i eq requestScope.pageInfo.pageNum}"> class="current" </c:if>>${i}</a>
    </c:forEach>


    <c:if test="${requestScope.pageInfo.pageNum lt requestScope.pageInfo.pages}">
        <a href="#" data-pagenum="${requestScope.pageInfo.pageNum+1}">下一页</a>
    </c:if>
    <a href="#" data-pagenum="${requestScope.pageInfo.pages}">尾页 </a>
    ${requestScope.pageInfo.pageNum}/${requestScope.pageInfo.pages}页
</div>

<script>

    $(function () {
        //批量删除
        $("#batchDel").click(function () {
            var idArr=new Array();
            $(":checked[id^='choose']").each(function () {
                var id = $(this).attr("id").slice(6);
                idArr.push(id);
            });
            if(idArr.length>0)
            {
                $.get(path+"/manage/company/batchDelete",
                    {ids:idArr.toString()},
                    function () {
                        for(var i=0;i<idArr.length;i++)
                        {
                            $("#tr"+idArr[i]).remove();
                        }
                    });
            }

        })



    })
</script>
